function select = f_selectfe(id_sim, id, exclude)
    id_sim_uniq = unique(id_sim)';
    id_uniq = unique(id)';
    select  = 1:length(id_uniq);

    selstart = id_uniq < id_sim_uniq(1 + exclude);
    select(selstart) = zeros(1, sum(selstart));

    for m = id_uniq
        if ~any(id_sim_uniq == m)
            select(id_uniq == m) = 0;
        end
    end
    select = select(select ~= 0)';
end
